package testDemo.Thread.ProducerAndCustomer;

import java.util.Random;

public class Producer implements Runnable {
    private Box box;
    private Random random = new Random();

    public Producer(Box box) {
        this.box = box;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            box.put(random.nextInt(5)+1);
        }
    }
}
